package com.jlkf.controller;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jlkf.service.TblIntegralSetService;

@Controller


@RequestMapping("integerSet")
public class TblIntegralSetController {
	@Autowired
	private TblIntegralSetService tblIntegralSetService;
	
	/**
     * 计算积分
     */
    @RequestMapping(value = "/calculateIntegral")
    @ResponseBody
    public Object calculateIntegral(Double money) throws Exception{
       return tblIntegralSetService.calculateIntegral(money);
    }
	
	/**
     * PC购买积分
     */
    @RequestMapping(value = "/buyIntegral",method = RequestMethod.POST)
    @ResponseBody
    public Object buyIntegral(@RequestBody String json) throws Exception{
       return tblIntegralSetService.buyIntegral(json);
    }
    
    /**
     * 积分明细(成长值明细)
     */
    @RequestMapping(value = "/getIntegralList")
    @ResponseBody
    public Object getIntegralList(Long userId,Integer type,Integer pageNumber,Integer pageSize) throws Exception{
       return tblIntegralSetService.getIntegralList(userId, type,pageNumber, pageSize);
    }
    
    /**
     * 计算1余额兑换多少积分
     */
    @RequestMapping(value = "/getIntegral")
    @ResponseBody
    public Object getIntegral() throws Exception{
       return tblIntegralSetService.getIntegral();
    }
    
}
